package com.itheima.test;

import java.util.Scanner;

public class test1 {
    public static void main(String[] args) {
        //计算机票价格
        //旺季（5-10）头等舱九折，经济舱八五折
        //淡季（11-4）头等舱七折，经济舱六五折

        //键盘录入
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入机票价格：");
        int ticketPrice = sc.nextInt();
        System.out.println("请输入月份：");
        int month = sc.nextInt();
        System.out.println("请输入头等舱0或经济舱1：");
        int seat = sc.nextInt();

        //判断月份是淡季还是旺季
        if(month>=5&&month<=10){
            //旺季
            getPrice(ticketPrice,seat,0.9,0.85);
        }else if(month>=11&&month<=12 || month>=1&&month<=4){
            //淡季
            getPrice(ticketPrice,seat,0.7,0.65);
        }else{
            System.out.println("月份输入有误！");
        }

    }

    public static void getPrice(int ticket,int seat,double v0,double v1){
        if(seat == 0){
            //头等舱
            System.out.println("头等舱："+ticket*v0);
        }else if(seat == 1){
            //经济舱
            System.out.println("经济舱："+ticket*v1);
        }else{
            System.out.println("输入有误！");
        }
    }
}


//ctrl+alt +m 抽取方法